HashiCorp Certified: Terraform Associate (004) v1.0

Page:    1 / 9   
Exam contains 128 questions

What does terraform apply change after you approve the execution plan? (Choose two.)

  • A. The state file
  • B. The cloud infrastructure
  • C. The execution plan
  • D. The Terraform code
  • E. The .terraform directory


Answer : AB

You modified your local Terraform configuration and ran terraform plan to review the changes. Simultaneously, your teammate manually modified the infrastructure component you are working on.
Since you already ran terraform plan locally, the execution plan for terraform apply will be the same.

  • A. True
  • B. False


Answer : B

Which is the correct workflow for deploying new infrastructure with Terraform?

  • A. 1. Write Terraform configuration.
    2. Run terraform apply to create infrastructure.
    3. Use terraform validate to confirm Terraform deployed resources correctly.
  • B. 1. Write Terraform configuration.
    2. Run terraform init to initialize the working directory or workspace.
    3. Run terraform apply.
  • C. 1. Write Terraform configuration.
    2. Run terraform plan to initialize the working directory or workspace.
    3. Run terraform apply to create the infrastructure.
  • D. 1. Write Terraform configuration.
    2. Run terraform show to view proposed changes.
    3. Run terraform apply to create new infrastructure.


Answer : B

After creating a new Terraform configuration, your config passes terraform validate but gives an “Access Denied” error from the cloud provider when running terraform plan.
Why didn’t validate catch this issue?

  • A. The working directory was not initialized, so the cloud provider plugin wasn’t available to use when running the terraform validate command.
  • B. The remote backend wasn’t configured, so terraform validate couldn’t load the state and detect the missing credentials.
  • C. terraform validate only checks if a configuration is syntactically correct and internally consistent, and does not communicate with providers.
  • D. Variables are only applied and validated during a terraform plan, so validate assumed defaults and returned the success message.


Answer : C

Only the user that generated a terraform plan may apply it.

  • A. True
  • B. False


Answer : B

terraform apply will fail if you have not run terraform plan first to update the plan output.

  • A. True
  • B. False


Answer : B

What’s the proper syntax for the plan command?

  • A. terraform plan -generate-config-out=tfplan
  • B. terraform plan -target=tfplan
  • C. terraform plan -out=tfplan
  • D. terraform plan -var-file=tfplan


Answer : C

Which is true about terraform apply? (Choose two.)

  • A. It only operates on infrastructure defined in the current working directory or workspace.
  • B. You cannot target specific resources for the operation.
  • C. Depending on provider specification, Terraform may need to destroy and recreate your infrastructure resources.
  • D. You must pass the output of a terraform plan command to it.
  • E. By default, it does not refresh your state file to reflect the current infrastructure configuration.


Answer : AC

Which syntax check returns an error when you run terraform validate?

  • A. None of these will return an error.
  • B. There is a missing variable block.
  • C. The state file does not match the current infrastructure.
  • D. The code contains tabs for indentation instead of spaces.


Answer : A

What is the purpose of the .terraform directory in a Terraform workspace?

  • A. The directory contains plugins and modules that Terraform downloads during initialization, along with other important information.
  • B. The directory contains the provide credentials and the .tfvars files to prevent them from being committed to version control by accident.
  • C. The directory is where Terraform creates and maintains the state file to track the underlying resources it creates and manages.
  • D. The directory is used to convert and store Terraform configuration files into API calls to communicate with the targeted platform.


Answer : A

How can terraform plan aid in the development process?

  • A. Validates your expectations against the execution plan without permanently modifying state.
  • B. Reconciles Terraform’s state against deploys resources and permanently modifies state using the current status of deployed resources.
  • C. Initializes your working directory containing your Terraform configuration files.
  • D. Formats your Terraform configuration files.


Answer : A

You have a saved execution plan containing desired changes for infrastructure managed by Terraform. After running the command terraform apply my.tfplan, you receive the error shown in the Exhibit space on this page.
| Error: Saved plan is stale
|
| The given plan file can no longer be applied because the state was changed by another operation after the plan was created.
How can you apply the desired changes? (Choose two.)

  • A. Generate a new execution plan file with terraform plan, and apply the new plan.
  • B. Run terraform apply without the saved execution plan.
  • C. Refresh the current state data using the -refresh-only flag.
  • D. Force the apply command by adding the flag -lock=false.
  • E. Update the current plan file using the terraform state push command.


Answer : AB

Which of these can you do with terraform plan? (Choose two.)

  • A. Schedule Terraform to run at a planned time in the future.
  • B. View the execution plan and check if the changes match your expectations.
  • C. Execute a plan in a different workspace.
  • D. Save a generated execution plan to apply later.


Answer : BD

Which task does terraform init not perform?

  • A. Sources any remote modules and downloads them.
  • B. Connects to the configured backend.
  • C. Validates that values are set for all required input variables.
  • D. Sources all providers used in the configuration and downloads them.


Answer : C

terraform init retrieves and caches the configuration for all remote modules.

  • A. True
  • B. False


Answer : A

Page:    1 / 9   
Exam contains 128 questions

Talk to us!


Have any questions or issues ? Please dont hesitate to contact us

Certlibrary.com is owned by MBS Tech Limited: Room 1905 Nam Wo Hong Building, 148 Wing Lok Street, Sheung Wan, Hong Kong. Company registration number: 2310926
Certlibrary doesn't offer Real Microsoft Exam Questions. Certlibrary Materials do not contain actual questions and answers from Cisco's Certification Exams.
CFA Institute does not endorse, promote or warrant the accuracy or quality of Certlibrary. CFA® and Chartered Financial Analyst® are registered trademarks owned by CFA Institute.
Terms & Conditions | Privacy Policy | Amazon Exams | Cisco Exams | CompTIA Exams | Databricks Exams | Fortinet Exams | Google Exams | Microsoft Exams | VMware Exams